Skip to content

NetworkSceneManger: Fixed bug where scenes will have empty path due to being created at runtime for physics simulations#2442

Closed
brogan89 wants to merge 4 commits intoUnity-Technologies:developfrom
brogan89:develop
Closed

NetworkSceneManger: Fixed bug where scenes will have empty path due to being created at runtime for physics simulations#2442
brogan89 wants to merge 4 commits intoUnity-Technologies:developfrom
brogan89:develop

Conversation

@brogan89
Copy link
Copy Markdown

@brogan89 brogan89 commented Mar 9, 2023

A runtime-created scene used for physics simulations doesn't have a path and therefore can not be loaded by NetworkManager.

Simply ignoring any scenes without a path fixes client connection issues for me.

SceneManager.CreateScene(SCENE_NAME, new CreateSceneParameters(LocalPhysicsMode.Physics3D))

Changelog

  • Fixed: NetworkSceneManger throwing an exception for empty scene paths due to being created at runtime for physics simulations

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

…o being created at runtime for physics simulations
@brogan89 brogan89 requested a review from a team as a code owner March 9, 2023 18:58
@unity-cla-assistant
Copy link
Copy Markdown

unity-cla-assistant commented Mar 9, 2023

CLA assistant check
All committers have signed the CLA.

@0xFA11 0xFA11 requested a review from NoelStephensUnity May 1, 2023 16:24
@NoelStephensUnity
Copy link
Copy Markdown
Member

NoelStephensUnity commented May 4, 2023

@brogan89
Could you take a look at this project that uses the branch for PR #2550 to see if this fix addresses your issue?
I approached it slightly differently to avoid a hard-coded solution to the problem and to allow the same mechanism used to exclude scenes to still be used.
RuntimeSceneSynchronizationExclusion.zip
You should be able to:

  • make a build
  • start a host
  • connect a client

And the host will not try to synchronize the runtime generated scene during the client's initial synchronization.

@brogan89
Copy link
Copy Markdown
Author

brogan89 commented May 4, 2023

@NoelStephensUnity yeah that worked fine

@NoelStephensUnity
Copy link
Copy Markdown
Member

@brogan89 Thank you very much for your contribution and taking the time to put this PR together.
#2550 is an alternate approach of this PR and will be used to resolve the same issue. The alternate approach is not a reflection of your proposed solution (perfectly valid approach), but was only used to preserve the standard way of excluding scenes from synchronization via NetworkSceneManager.VerifySceneBeforeLoading.

I am going to close this PR at this time.
Once again, thank you for your contribution and time spent!! 💯 👍

@brogan89
Copy link
Copy Markdown
Author

brogan89 commented May 4, 2023

No worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants